Conversation
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/cli@0.0.47-pr.441.3070a4fPrefer not to change any import paths? Install using npm alias so your code still imports npm i "base44@npm:@base44-preview/cli@0.0.47-pr.441.3070a4f"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.0.47-pr.441.3070a4f"
}
}
Preview published to npm registry — try new features instantly! |
|
@artemdemo I wonder what do you think about this. moving the runTask to be injected from the CLIContext.
|
| } | ||
|
|
||
| /** | ||
| * Creates a RunTaskFn that delegates to the provided logger for non-interactive environments. |
There was a problem hiding this comment.
Delegates what? :)
Description is a bit unclear
There was a problem hiding this comment.
@artemdemo I wonder what do you think about this. moving the runTask to be injected from the CLIContext.
It's nice to have it support non interactive and such
I feel that maybe it's not the right place for runTask 🤔
non interractive runTask is a good idea.
but what do you mean about the place? Like you don't want to place it in the context?
You're actually don't have to.
You can just check interactivity in runTask itself and then use spinner or logger
08bee8d to
3670a34
Compare
Note
Description
This PR refactors
runTaskfrom a single module-level function into a factory pattern with two implementations:createInteractiveRunTask()(uses a clack spinner) andcreateSimpleRunTask(log)(uses the logger). The chosen implementation is created at startup based on TTY detection and injected intoCLIContext, so commands now receiverunTaskvia dependency injection rather than importing it directly. This also fixes non-interactive environments where the spinner was previously used even when stdout was not a TTY.Related Issue
None
Type of Change
Changes Made
RunTaskFntype and replaced the singlerunTaskexport withcreateInteractiveRunTask()andcreateSimpleRunTask(log)factory functions inrunTask.tsrunTask: RunTaskFnfield toCLIContextand removedrunTaskfrom theutils/index.tsbarrel exportrunTaskimplementation incli/index.tsbased on TTY detection (isNonInteractive) and injected it intoCLIContextrunTaskfromCLIContextinstead of importing it directlyTesting
npm test)Checklist
docs/(AGENTS.md) if I made architectural changesAdditional Notes
The
createSimpleRunTaskimplementation logs the start message vialog.info, progress updates vialog.info, success vialog.success, and errors vialog.error— mirroring the spinner lifecycle for non-interactive consumers.🤖 Generated by Claude | 2026-03-24 00:00 UTC